package com.openbravo.pos.panels;

import java.util.ArrayList;
import java.util.Enumeration;
import javax.swing.tree.TreeNode;

public class SQLTable
  implements TreeNode
{
  private SQLDatabase m_db;
  private String m_sName;
  private ArrayList m_aColumns;

  public SQLTable(SQLDatabase paramSQLDatabase, String paramString)
  {
    this.m_db = paramSQLDatabase;
    this.m_sName = paramString;
    this.m_aColumns = new ArrayList();
  }

  public String getName()
  {
    return this.m_sName;
  }

  public void addColumn(String paramString)
  {
    SQLColumn localSQLColumn = new SQLColumn(this, paramString);
    this.m_aColumns.add(localSQLColumn);
  }

  public String toString()
  {
    return this.m_sName;
  }

  public Enumeration children()
  {
    return new EnumerationIter(this.m_aColumns.iterator());
  }

  public boolean getAllowsChildren()
  {
    return true;
  }

  public TreeNode getChildAt(int paramInt)
  {
    return (TreeNode)this.m_aColumns.get(paramInt);
  }

  public int getChildCount()
  {
    return this.m_aColumns.size();
  }

  public int getIndex(TreeNode paramTreeNode)
  {
    return this.m_aColumns.indexOf(paramTreeNode);
  }

  public TreeNode getParent()
  {
    return this.m_db;
  }

  public boolean isLeaf()
  {
    return this.m_aColumns.size() == 0;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.panels.SQLTable
 * JD-Core Version:    0.6.0
 */